using Admin.NET.Core;
using MOKA.TPM.Entity;
using System.ComponentModel.DataAnnotations;

namespace MOKA.TPM.Service.Dto;

/// <summary>
/// 页面输出参数 （入库主表）
/// </summary>
public class PartInMOutput : PartInM
{
    /// <summary>
    /// 入库类型 （字典名称）
    /// </summary>
    public string? InTypeName { get; set; }

    /// <summary>
    /// 入库状态 （字典名称）
    /// </summary>
    public string? InStatusName { get; set; }

    /// <summary>
    /// 入库车间 （字典名称）
    /// </summary>
    public string? WorkshopName { get; set; }

    public string BillNo { get; set; } //唯一索引

    /// <summary>
    /// 关联对象等
    /// </summary>
    //public string? WePartyLevelName { get; set; }
}

/// <summary>
/// 单ID查询参数
/// </summary>
public class PartInMInput
{
    /// <summary>
    /// </summary>
    public Guid? Id { get; set; }

    /// <summary>
    /// 入库单号
    /// </summary>
    public string? BillNo { get; set; }  //唯一索引
}

/// <summary>
/// 普通查询参数
/// </summary>
public class GetPartInMInput : BaseOrderInput
{
}

/// <summary>
/// 分页查询参数
/// </summary>
public class PagePartInMInput : BasePageInput
{
    /// <summary>
    /// 入库单号
    /// </summary>
    public string? BillNo { get; set; }  //唯一索引
}

/// <summary>
/// 新增记录参数
/// </summary>
public class AddPartInMInput
{
    /// <summary>
    /// 入库单号
    /// </summary>
    [Required, MaxLength(50)]
    public string BillNo { get; set; } = string.Empty;

    /// <summary>
    /// 入库类型
    /// </summary>
    public Guid InType { get; set; }

    /// <summary>
    /// 入库状态
    /// </summary>
    public Guid InStatus { get; set; }

    /// <summary>
    /// 入库车间
    /// </summary>
    public Guid Workshop { get; set; }

    /// <summary>
    /// 入库时间
    /// </summary>
    public DateTime InTime { get; set; }

    /// <summary>
    /// SAP申领单号
    /// </summary>
    [MaxLength(50)]
    public string? RequestNo { get; set; }

    /// <summary>
    /// SAP申领单行号
    /// </summary>
    public int? RequestItemNo { get; set; }

    /// <summary>
    /// SAP申请数量
    /// </summary>
    public decimal? RequestQty { get; set; }

    /// <summary>
    /// 确认人
    /// </summary>
    [MaxLength(50)]
    public string? ConMan { get; set; }

    /// <summary>
    /// 确认人姓名
    /// </summary>
    [MaxLength(50)]
    public string? ConManName { get; set; }

    /// <summary>
    /// 确认时间
    /// </summary>
    public DateTime? ConTime { get; set; }

    /// <summary>
    /// 备注
    /// </summary>
    [MaxLength(200)]
    public string? Remark { get; set; }

    /// <summary>
    /// SAP凭证号
    /// </summary>
    [MaxLength(50)]
    public string? SapVoucher { get; set; }

    /// <summary>
    /// SAP凭证行号
    /// </summary>
    public int? SapVoucherItemNo { get; set; }

    /// <summary>
    /// SAP创建时间
    /// </summary>
    public DateTime? CreateTimeInSAP { get; set; }

    /// <summary>
    /// SAP更新时间
    /// </summary>
    public DateTime? UpdateTimeInSAP { get; set; }

    /// <summary>
    /// SAP同步时间
    /// </summary>
    public DateTime? SyncTime { get; set; }

    /// <summary>
    /// 创建人
    /// </summary>
    [Required, MaxLength(20)]
    public string CreateUser { get; set; } = string.Empty;

    /// <summary>
    /// 创建时间
    /// </summary>
    public DateTime CreateTime { get; set; }

    /// <summary>
    /// 修改人
    /// </summary>
    [MaxLength(20)]
    public string? UpdateUser { get; set; }

    /// <summary>
    /// 修改时间
    /// </summary>
    public DateTime? UpdateTime { get; set; }
}

/// <summary>
/// 更新参数
/// </summary>
public class UpdatePartInMInput
{
    /// <summary>
    /// </summary>
    public Guid Id { get; set; }

    /// <summary>
    /// 入库单号
    /// </summary>
    [MaxLength(50)]
    public string BillNo { get; set; }

    /// <summary>
    /// 入库类型
    /// </summary>
    public Guid InType { get; set; }

    /// <summary>
    /// 入库状态
    /// </summary>
    public Guid InStatus { get; set; }

    /// <summary>
    /// 入库车间
    /// </summary>
    public Guid Workshop { get; set; }

    /// <summary>
    /// 入库时间
    /// </summary>
    public DateTime InTime { get; set; }

    /// <summary>
    /// SAP申领单号
    /// </summary>
    [MaxLength(50)]
    public string? RequestNo { get; set; }

    /// <summary>
    /// SAP申领单行号
    /// </summary>
    public int? RequestItemNo { get; set; }

    /// <summary>
    /// SAP申请数量
    /// </summary>
    public decimal? RequestQty { get; set; }

    /// <summary>
    /// 确认人
    /// </summary>
    [MaxLength(50)]
    public string? ConMan { get; set; }

    /// <summary>
    /// 确认人姓名
    /// </summary>
    [MaxLength(50)]
    public string? ConManName { get; set; }

    /// <summary>
    /// 确认时间
    /// </summary>
    public DateTime? ConTime { get; set; }

    /// <summary>
    /// 备注
    /// </summary>
    [MaxLength(200)]
    public string? Remark { get; set; }

    /// <summary>
    /// SAP凭证号
    /// </summary>
    [MaxLength(50)]
    public string? SapVoucher { get; set; }

    /// <summary>
    /// SAP凭证行号
    /// </summary>
    public int? SapVoucherItemNo { get; set; }

    /// <summary>
    /// SAP创建时间
    /// </summary>
    public DateTime? CreateTimeInSAP { get; set; }

    /// <summary>
    /// SAP更新时间
    /// </summary>
    public DateTime? UpdateTimeInSAP { get; set; }

    /// <summary>
    /// SAP同步时间
    /// </summary>
    public DateTime? SyncTime { get; set; }

    /// <summary>
    /// 创建人
    /// </summary>
    [MaxLength(20)]
    public string CreateUser { get; set; }

    /// <summary>
    /// 创建时间
    /// </summary>
    public DateTime CreateTime { get; set; }

    /// <summary>
    /// 修改人
    /// </summary>
    [MaxLength(20)]
    public string? UpdateUser { get; set; }

    /// <summary>
    /// 修改时间
    /// </summary>
    public DateTime? UpdateTime { get; set; }
}

/// <summary>
/// 删除参数
/// </summary>
public class DeletePartInMInput
{
    /// <summary>
    /// </summary>
    public Guid Id { get; set; }
}

/// <summary>
/// 更新部分数据参数
/// </summary>
public class UpdateSomePartInMInput
{
    /// <summary>
    /// </summary>
    public Guid Id { get; set; }

    /// <summary>
    /// 入库单号
    /// </summary>
    public string? BillNo { get; set; }  //唯一索引
}